<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>vip</title>
  <!-- 引入样式 -->
  <link rel="stylesheet" href="../plugins/elementui/index.css">
  <link rel="stylesheet" href="../css/style.css">
</head>
<body>
<div id="app">
  <h1>VIP页面</h1>
  <el-card class="box-card" style="float: left;margin-left: 20px;cursor: pointer">
    <div class="text item">
      角色为VIP才能访问的接口:
      <el-button @click="getInfo()">点击发送请求</el-button>
      <br>
      访问的接口为: http://localhost/users/vip
      <br>
      获取到的数据为:
      <div>{{ resMessage }}</div>
    </div>
  </el-card>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script src="../js/axios-0.18.0.js"></script>

<script>
  let vue = new Vue({
    el: '#app',
    data() {
      return {
        resMessage:''
      }
    },
    methods: {
      getInfo() {
        axios.get('/users/vip').then((res) => {
          this.resMessage = res.data
        })
      },
    }
  })

</script>
</html>